gridview: Limit rectangle to gridview columns
authorCorey Berla <corey@berla.me>
Thu, 5 May 2022 04:33:26 +0000 (21:33 -0700)
committerCorey Berla <corey@berla.me>
Tue, 26 Jul 2022 00:27:24 +0000 (17:27 -0700)
commitc6f357e44735a25feda5b6404bc62e765bc8f23d
treeaccff3816372b613a07e1ca470b48364cad66339
parent2bcae546b34022774ed8f9719770e0173f8916bf
gridview: Limit rectangle to gridview columns

The function gtk_grid_view_get_items_in_rect() erroneously calculates
columns less than 0 and greater than n_columns when the user attempts
to rubberband all the way to the left or right respectively.  This
causes the rubberband to persistent and creates unexpected behavior.
Limit the rows to a minimum of 0 and maximum of n_columns - 1.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3445
gtk/gtkgridview.c